#ifndef DTWENTYITEMMODEL_H
#define DTWENTYITEMMODEL_H


#include "dtwentycore_global.h"
#include <itemtablemodel.h>
#include <QSortFilterProxyModel>


class DTWENTYCORESHARED_EXPORT DTwentyItemsModel : public QSortFilterProxyModel
{
    Q_OBJECT

    Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged)

    static const int DATAROLE_OFFSET = ItemTableModel::Role_LAST + 1;

public:

    explicit DTwentyItemsModel(QObject *parent = 0);
    explicit DTwentyItemsModel(const QMetaObject& dataMetaObj, QObject *parent = 0);

    virtual QHash<int, QByteArray> roleNames() const;
    virtual QVariant data(const QModelIndex &index, int role) const;

    Q_INVOKABLE QObject* get(int row) const;

    void setDataMetaObject(const QMetaObject* metaObj);


signals:

    void rowCountChanged();


protected:

    const QMetaObject& m_dataMetaObj;


};



#endif // DTWENTYITEMMODEL_H
